package com.guan.weibo.qq;

import com.tencent.weibo.oauthv2.OAuthV2;

public class OAuthFactory {

    private static OAuthV2 oAuth;

    private OAuthFactory() {

    }

    public static OAuthV2 getOAuth() {
        if (oAuth == null) {
            init();
        }
        return oAuth;
    }

    private static synchronized void init() {
        if (oAuth != null) {
            return;
        }
        oAuth = new OAuthV2();
        oAuth.setClientId(QQWeiboConstant.ClientId);
        oAuth.setClientSecret(QQWeiboConstant.ClientSecret);
        oAuth.setRedirectUri(QQWeiboConstant.RedirectUri);
        oAuth.setAccessToken(QQWeiboConstant.AccessToken);
        oAuth.setOpenid(QQWeiboConstant.Openid);
        oAuth.setOpenkey(QQWeiboConstant.Openkey);
        oAuth.setExpiresIn("604800");
    }
}
